home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 2,801 to 2,900
/
aol-file-protocol-4400-2801-to-2900.zip
/
AOLDLs
/
C++ Files Library
/
Direct Blitting in C++
/
Blitting.sit
/
Blitting ƒ
/
StGWorldSetter.h
< prev
next >
Wrap
Text File
|
1995-04-23
|
1KB
|
53 lines
// StGWorldSetter.h, a stack based GWorld setter and restorer
//
// Copyright ⌐ 1995, Macneil Shonle. All rights reserved.
#ifndef __STGWORLDSETTER__
#define __STGWORLDSETTER__
#ifndef __QDOFFSCREEN__
#include <QDOffscreen.h>
#endif
#ifndef __CDIRECTBLIT__
#include <CDirectBlit.h>
#endif
class StGWorldSetter {
public:
StGWorldSetter( CGrafPtr port, GDHandle gdh = nil );
StGWorldSetter( WindowRef port );
StGWorldSetter( GWorldPtr port );
StGWorldSetter( CDirectBlit &port );
~StGWorldSetter();
private:
CGrafPtr mOrigPort;
GDHandle mOrigDev;
};
inline StGWorldSetter::StGWorldSetter( CGrafPtr port, GDHandle gdh )
{ ::GetGWorld( &mOrigPort, &mOrigDev );
::SetGWorld( port, gdh );
}
inline StGWorldSetter::StGWorldSetter( WindowRef port )
{ ::GetGWorld( &mOrigPort, &mOrigDev );
::SetGWorld( CGrafPtr(port), GetMainDevice() );
}
inline StGWorldSetter::StGWorldSetter( GWorldPtr port )
{ ::GetGWorld( &mOrigPort, &mOrigDev );
::SetGWorld( CGrafPtr(port), nil );
}
inline StGWorldSetter::StGWorldSetter( CDirectBlit &port )
{ ::GetGWorld( &mOrigPort, &mOrigDev );
::SetGWorld( port.GetMacPort(), port.GetMacDevice() );
}
inline StGWorldSetter::~StGWorldSetter()
{ ::SetGWorld( mOrigPort, mOrigDev );
}
#endif